package com.ay.wiki_plt.service.Impl;

import com.ay.wiki_plt.service.WsService;
import com.ay.wiki_plt.websocket.WebSocketServer;
import jakarta.annotation.Resource;
import org.slf4j.MDC;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;


/*
* 只用来发送消息
* */
@Service
public class WsServiceImpl implements WsService {

    @Resource
    public WebSocketServer webSocketServer;


    @Async
    @Override
    public void sendInfo(String message, String logId) {
        MDC.put("LOG_ID", logId);
        webSocketServer.sendInfo(message);
    }

}
